﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "TcpServer.h"
#include "computer.h"
#include "computerinfowidget.h"
#include "needupdateappcomputerwidget.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    void checkAutoStart();

    void init();

private slots:
    void on_autoStartRadioButton_clicked(bool autoStart);

    void on_listenSocketLineEdite_editingFinished();

    void on_clientListenSocketLineEdite_editingFinished();

    void on_addComputerButton_clicked(bool checked);

    void on_computersUpdated();

    void on_needUpdateAppsComputerChanged();

    void on_computerQueryConditionsChanged();

    void on_offlineAndALarmCountUpdate(int offLineCount, int allComputerCount, int unreadAlarmCount);


    void on_sendEmailIntervalSecondsLineEdit_editingFinished();

    void on_sendEmailTosLineEdit_editingFinished();

    void on_smtpAddressLineEdit_editingFinished();


    void on_smtpPortLineEdit_editingFinished();

    void on_sendEmailFromLineEdite_editingFinished();

    void on_smtpUserNameLineEdit_editingFinished();

    void on_smtpPasswdLineEdit_editingFinished();

    void on_getFromDBButton_clicked(bool checked);

    void on_appNamesComboBox_currentIndexChanged(const QString &arg1);

    void on_pushButton_clicked();

private:
    Ui::MainWindow *ui;

    TcpServer * server;

    list<ComputerInfoWidget *> computerInfoWidgets;

    list<NeedUpdateAppComputerWidget *> updateAppsComputerInfoWidgets;
};

#endif // MAINWINDOW_H
